﻿$(document).ready(function () {
    $("#btnBack").click(function () {
        var backUrl = $("#hd_backUrl").val();
        if (backUrl)
            window.location = backUrl;
        else
            window.location = history.go(-1);
    });

    $("#tBodyRows").delegate('tr', 'mouseover', function () { $(this).css("background-color", "#b6bdca"); });
    $("#tBodyRows").delegate('tr', 'mouseout', function () { $(this).removeAttr("style"); });

    $("#main-nav").find("a[name='firstMenu']").each(function (i, el) {
        $(el).bind("click", function () {
            $("#main-nav").find("a[name='firstMenu']").each(function (index, element) {
                if ($(el).attr("varId") == index) {
                    $(element).toggleClass("current");
                } else {
                    $(element).removeClass("current");
                }
            });
        });
    });
});